server
	var
		address		//ip address
		port		//port
		shard		//boolean: if true server acts as a world, if false server acts as login server

libServer
	parent_type = /libBase
	var
		tblServers	//Server table name in MySQL

	proc
		createServerTable()
			if(!Core.DB.DBCon.IsConnected()) Core.DB.establishConnection()

			if(existsServerTable()) return FALSE

			var/sql = {"
			CREATE TABLE `[Core.DB.getDB()]`.`[getServerTable()]` (
				address VARCHAR(15) NOT NULL,
				port INTEGER NOT NULL,
				shard BOOLEAN NOT NULL,
				online DATETIME,
				file VARCHAR(255) NOT NULL
				) ENGINE=InnoDB;
			"}

			Core.DB.runQuery(sql)

			return existsServerTable()

		existsServerTable()
			var/DBQuery/q = Core.DB.Query("Describe [getServerTable()]")
			return q.Execute()

		getServerTable()
			return tblServers


	New()
		..()
		createServerTable()



/*
	Add libServer to CORE

*/

libCore
	var/libServer/Server

	New()
		..()
		world.log<<"libCORE NEW"
		Server = new()